<?php

namespace app\mini\validate;

use think\Validate;

class MiniProgramValidate extends Validate
{
    /**
     * 验证规则
     * @var string[]
     */

    protected $rule = [

        'id'                    => 'integer|gt:0',
        'probability'                  => 'require|integer|between:0,1000',
        'name'                  => 'require',
        'url'                   =>'require|url',
        'object'                  => 'require|integer',
        'status'                  => 'require|integer',
        'position'                  => 'require|integer|between:1,8',
        'event_id'                  => 'require|integer|gt:0',

    ];


    /**
     * 错误信息
     * @var string[]
     */

    protected $message = [

//        'customer_id.require' => '客户id未填',
//
//        'customer_id.number' => '客户id必须为纯数字',
//
//        'customer_id.gt' => '客户id错误',
//
//        'point_goods_id.require' => '积分商品id错误',
//
//        'point_goods_id.number' => '积分商品id必须为纯数字',
//
//        'point_goods_id.gt' => '积分商品id错误',


    ];


    /**
     * 场景
     * @var \string[][]
     */

    protected $scene = [
        'updatePrize' => ['name', 'url','probability','status','position'],
    ];
}
